Many applications, such as games and office productivity software, are configured to generate graphics for display on computer systems. The graphics may include two-dimensional graphics or three-dimensional graphics. The graphics may be generated by software executing on a conventional central processing unit (CPU). Alternatively, the graphics may be generated by hardware implemented in a specialized co-processing unit such as a graphics processing unit (GPU), or by some combination of hardware and software executed by either the CPU and/or the GPU. In order to make the programming of such applications easier, special graphics application programming interfaces (APIs) such as DirectX and OpenGL, among others, were created to create an abstraction between the functionality of generating graphics and the hardware used to implement such functionality.
An API may specify an abstract graphics rendering pipeline that defines different steps in the rendering of graphics. For example, a graphics rendering pipeline specified by the OpenGL API may include a vertex shading stage, a geometry shading stage, a rasterization stage, and a fragment shading stage. The graphics rendering pipeline receives graphics primitives specified by the application and processes those primitives through each of the stages of the graphics processing pipeline to produce pixel data for display on a display device. The rasterization stage describes the operation of transforming a primitive such as a triangle into a number of fragments for processing by a fragment shading stage. In other words, the primitive, which is specified by a plurality of vertices, is intersected with the pixels (or sub-samples of the pixels) specified for a particular screen space and attribute values associated with the primitive are interpolated across the primitive tier each of the pixels (or sub-samples of the pixels).
When anti-aliasing techniques are implemented, coverage information that indicates which sub-samples of a pixel are covered by a primitive may also be generated during rasterization. Typically, this coverage information is specified as a mask. The mask may correspond to a particular fragment of the primitive and each element in the mask may correspond to a particular sub-sample of the pixel. For example, if a particular pixel includes 16 sub-samples, then the mask may include 16 bits that indicate whether each of the sub-samples in that pixel is covered by the primitive. Certain algorithms may wish to change the coverage information associated with a given fragment. However, conventional hardware may not be configured to update the coverage information generated during the rasterization stage arbitrarily. Thus, there is a need for addressing these issues and/or other issues associated with the prior art.